#include "stdafx.h"
#include "version_encodings.h"
#include "version_thumbprint.h"

using namespace System;

namespace O1 {
	namespace Storage{
		namespace VersionEncodings {
			
			std::array<long long, 2> SplitVersion(Guid& version)
			{
				auto p = gcnew version_thumprint(version);
				return std::array < long long, 2 > { { p->Index, p->VersionId } };
			}

			Guid^ PackVersion(const std::array<long long, 2>& version)
			{
				auto p = gcnew version_thumprint(version[0], version[1]);
				return gcnew Guid(p->a, p->b, p->c, p->d, p->e, p->f, p->g, p->h, p->i, p->j, p->k);
			}
		}
	}
}
